package cn.oldsix.spark.utils;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.PathFilter;

/*
 * @Author : Wu.D.J
 * @Date : 2017/7/25 0025
 * @Description :
 */

public class RegexAcceptPathFilter implements PathFilter {

    private final String regex;

    public RegexAcceptPathFilter(String regex) {
        this.regex = regex;
    }

    public boolean accept(Path path) {
        boolean flag = path.toString().matches(regex);
        return flag;
    }

}
